package com.foxire.method1reference;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class Student {
    // 姓名 年龄 性别 身高
    private String name;
    private int age;
    private int height;
    private String sex;

    public static int compareByAge(Student o1, Student o2){
        return o1.getAge() - o2.getAge();
    }
    public int compareByHeight(Student o1, Student o2){
        return Double.compare(o1.getHeight(), o2.getHeight());
    }
}
